package com.vd.dsl;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

public class Graph {
	private List<Edge> edges;
	private Set<Vertex> vertices;
	public Graph() {
		this.edges=new ArrayList<Edge>();
		this.vertices=new TreeSet<Vertex>();
	}
	public List<Edge> getEdges() {
		return edges;
	}
	public Set<Vertex> getVertices() {
		return vertices;
	}
	public void addEdge(Edge edge){
		this.edges.add(edge);
	}
	public void addVertice(Vertex vertex){
		this.vertices.add(vertex);
	}
	public static void printGraph(Graph g){
		System.out.println("Vertices start....");
		for(Vertex v:g.getVertices()){
			System.out.println(v.getLabel()+ " ");
		}
		System.out.println("");
		System.out.println("Edges start ......");
		for(Edge e:g.getEdges()){
			System.out.println(e);
		}
	}
	
}
